package cn.kgc.spring03.entity;

import java.sql.Connection;
import java.sql.DriverManager;

/**
 * @author: mosin
 * @version: v1.0  2022/11/30
 * 静态工厂
 */
public class ConnectionStaticFactory {

    public static Connection getConnection() throws Exception {
        Class.forName("com.mysql.jdbc.Driver");
        String url = "jdbc:mysql:///java2217?serverTimezone=UTC";
        String username = "root";
        String pwd = "root";
        Connection connection = DriverManager.getConnection(url, username, pwd);
        return connection;
    }
}
